package com.cjk.foundation.commons.response;

import java.io.Serializable;

public class PageResponse extends Response {

	private static final long serialVersionUID = -8847934266895305801L;
	private static final Serializable EMPTY = new Object[0];

	private Integer total;
	private Integer page;

	public static PageResponse error(String message) {
		return new PageResponse(true, message, 0, 0, EMPTY);
	}

	public static PageResponse success(Integer total, Integer page, Object data) {
		return success(total, page, "", data);
	}

	public static PageResponse success(Integer total, Integer page, String message, Object data) {
		return new PageResponse(true, message, total, page, data);
	}

	public PageResponse(boolean success, String message, Integer total, Integer page, Object data) {
		super(success, message, data);
		this.total = total;
		this.page = page;
	}

	public Integer getTotal() {
		return total;
	}

	public void setTotal(Integer total) {
		this.total = total;
	}

	public Integer getPage() {
		return page;
	}

	public void setPage(Integer page) {
		this.page = page;
	}

}
